import { Map } from "immutable";
const defaultState = Map({
  allChannels:[
  {name:'推荐',id:'0'},
  {name:'居家生活',id:'1010000'},
  {name:'服饰鞋包',id:'1005000'},
  {name:'美食酒水',id:'1005002'},
  {name:'个护清洁',id:'1013001'},
  {name:'母婴亲子',id:'1011000'},
  {name:'运动旅行',id:'109243029'},  
  {name:'数码家电',id:'1043000'},
  {name:'严选全球',id:'1019000'}],
  showAllTabs:false,
  labeIndex:0,
  id:'0',
  sumLeftWidth:0
});
export default (state = defaultState, action) => {
    if (action.type === 'UPDATE_SHOW_TABS') {
        return state.set('showAllTabs', !action.payload);
      }else if(action.type === 'LABE_CHANG_INDEX') {
        return state.set('labeIndex',action.payload)
      }
      else if(action.type === 'ROUTING_ID') {
        return state.set('id',action.payload)
      }
      else if(action.type === 'UPDATE_SUM_WIDTH') {
        return state.set('sumLeftWidth',action.payload)
      }
      else {
        return state.set()
      }
}